Skip to content

Split the AMI bake out of remote bootstrap - #142

Merged
outofcoffee merged 5 commits into
mainfrom
split-bake-from-bootstrap
Sep 2, 2026
Merged

Split the AMI bake out of remote bootstrap#142
outofcoffee merged 5 commits into
mainfrom
split-bake-from-bootstrap

Conversation

@outofcoffee

@outofcoffee outofcoffee commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Split the AMI bake out of spinloop remote bootstrap into its own spinloop remote bake command (issue #139).

Summary

  • New spinloop remote bake [runner...] command: starts an AMI bake for each named runner (default: both llamacpp and vllm) and waits until the AMI(s) are available, so it returns at the point spinloop remote deploy can go; --no-wait returns once the bakes are queued, for running them in parallel with a weight seed. It reuses bootstrap's version-matched source download, package-manager preflight, and --ref/--dir/--region/--package-manager flags
  • BREAKING: spinloop remote bootstrap no longer starts any bake — the --runners, --wait, and --force-bake flags are removed, and the sequence is just install → cdk bootstrapdeploy:imagedeploy
  • Bootstrap's success output signposts spinloop remote bake as the next step, ahead of spinloop remote deploy
  • The bare-group usage (spinloop remote / fleet / remote seed) was a hand-rolled subcommand list that had already drifted (it did not name bake); the group parents now show the help cobra generates from the tree, and a mistyped subcommand is cobra's own unknown-command error
  • Spec deltas for endpoint-provisioning (new bake requirement, bootstrap requirements trimmed of the bake) and remote-endpoint (command group gains bake)

Implementation details

  • Bake is a first-class command rather than a printed pnpm bake recipe: bootstrap's sources sit in a ref-keyed cache under the user config dir, pruned after success, so there is no stable path to signpost
  • Wait is the default (60 s poll, 60-minute bound) because a cold first deploy otherwise finds no AMI to launch from; the bound means a failed bake is reported rather than hung on. --no-wait prints how to check on the builds
  • Bake deploys nothing, but fails early naming spinloop remote bootstrap when the control plane is absent — the pnpm bake script's own error tells the user to run pnpm deploy:image by hand
  • No consent gate on bake (an explicit, narrow user action costing a 20–40 min builder instance); bootstrap keeps its plan-and-confirm
  • The dead cdk.json context.runners write goes with --runners: the CDK reads no such key, and the image stack always creates both runners' pipelines
  • The shared machinery (step seams, source resolution, waitForBake, the package-manager preflight) is renamed and factored into remote_sources.go so both commands use it
  • The group-parent help sentinel is pflag's ErrHelp, not the stdlib one: cobra's ExecuteC checks pflag's, and the stdlib twin surfaces as a bare "flag: help requested" error

Bake's next step is spinloop remote deploy, which needs the AMI, so the common path should block until it is available; --no-wait keeps the bake-and-seed-in-parallel option.
bootstrap now stops at the control plane (install, cdk bootstrap,
deploy:image, deploy) and signposts the next step; the bake moves to
a first-class `spinloop remote bake [runner...]` command that waits
for the AMI(s) by default and offers --no-wait to run bakes in
parallel with a weight seed.

The --runners, --wait and --force-bake flags go with the bake loop,
along with the dead cdk.json context.runners write. The shared
machinery (the step seams, source resolution, waitForBake, the
package-manager preflight) is renamed and factored so both commands
use it, and the BakedRunners poll that bootstrap --wait once used is
bake's own wait.
@outofcoffee outofcoffee changed the title docs(openspec): propose splitting the bake from bootstrap Split the AMI bake out of remote bootstrap Sep 1, 2026
The bare-group usage was a hand-rolled list of subcommand names, and
it had drifted: `spinloop remote` did not name `bake`. The group
parents (fleet, remote, seed) now do nothing themselves: bare, they
show the help cobra generates from the tree, and a word that is not a
subcommand is cobra's own unknown-command error.

The help sentinel has to be pflag's, not the stdlib one — cobra's
ExecuteC checks pflag.ErrHelp (cobra imports pflag as its flag
package), and the stdlib twin surfaces as a bare "flag: help
requested" error.

The docs follow: the README's remote line gains bake, and
docs/commands/remote.md notes that bootstrap and bake take no
Spinloop and that deploy — not bootstrap — registers an environment.
@outofcoffee
outofcoffee marked this pull request as ready for review September 2, 2026 00:31
@outofcoffee
outofcoffee merged commit 59ea4ab into main Sep 2, 2026
3 checks passed
@outofcoffee
outofcoffee deleted the split-bake-from-bootstrap branch September 2, 2026 00:37
@outofcoffee outofcoffee linked an issue Sep 3, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: split bake from bootstrap

1 participant